package serviceImpl;

import dao.AddDAO;
import dao.GroupDAO;
import dao.UserDAO;
import entity.Group;
import entity.User;
import groupInformation.Relation;
import lombok.SneakyThrows;
import serviceInterface.addInterface;

public class add implements addInterface {
    @SneakyThrows
    @Override
    public boolean add(Group group, User user){
        boolean add_group = false;
        //增加小组和用户
        AddDAO addGroup = new AddDAO();
        UserDAO addUser = new UserDAO();
        //如果传入的小组不为空,增加group
        //如果传入的用户不为空，则增加user
        Relation relation=new Relation();




        if (addGroup.search(group)!=true){
            addGroup.insertGroup(group);
        }
        else {
      //      addGroup.insertGroupUser(relation);
        }
        return add_group;
    }
}
